using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using QLKS.DataLayer.BusinessObjects;
using QLKS.DataLayer.Base;

namespace QLKS.DataLayer.ManagerObjects
{
    public partial interface ICTHoaDonManager : IManagerBase<CTHoaDon, int>
    {
		// Get Methods
		IList<CTHoaDon> GetByMaCTPhieuThue(System.Int32 cTPhieuThuePhong);
    }

    partial class CTHoaDonManager : ManagerBase<CTHoaDon, int>, ICTHoaDonManager
    {
		#region Constructors
		
		public CTHoaDonManager() : base()
        {
        }
        public CTHoaDonManager(INHibernateSession session) : base(session)
        {
        }
		
		#endregion
		
        #region Get Methods

		
		public IList<CTHoaDon> GetByMaCTPhieuThue(System.Int32 cTPhieuThuePhong)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(CTHoaDon));
			
			
			ICriteria cTPhieuThuePhongCriteria = criteria.CreateCriteria("CTPhieuThuePhong");
            cTPhieuThuePhongCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", cTPhieuThuePhong));
			
			return criteria.List<CTHoaDon>();
        }
		
		#endregion
    }
}